package read_input;

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;

public class SimpleFileReader {
	private String filePath;
	
	ArrayList <String> filesNames = new ArrayList<String>();
	public SimpleFileReader(String filePath) {
		this.filePath = filePath;
	}
	public ArrayList <String> readFile(){
		try {
			BufferedReader br;
			//open the file that is the first command line parameter
			br= new BufferedReader(new FileReader(filePath));
			//read lines from file
			String strLine = null;
			while ((strLine = br.readLine()) != null) { 
				filesNames.add(strLine);
			}
		} catch (FileNotFoundException e) { 
			e.printStackTrace();
		} catch (NumberFormatException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
		return filesNames;
	}
	
	public ArrayList<String> getFilesNames() {
		return filesNames;
	}
}
